import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  lang: 'zh-CN',
  base: '/',
  cleanUrls: true,
  title: "学习Go语言",
  titleTemplate: "Go语言",
  description: "这是一个以web前端视角学习Go语言的教程",
  lastUpdated: true,
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    search: {
      provider: 'local'
    },
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2023-present TOmWang'
    },
    nav: [
      {
        text: '学习',
        items: [
          {
            text: '开始顺序',
            items: [
              {
                text: '基础',
                link: '/guide/introduction/index',
              },
              {
                text: '进阶',
                link: '/advanced/introduction/index',
              }
            ]
          },
        ]
      },
      { text: '案例', link: '/examples/index' },
      { text: '更新日志', link: '/release' }
      // { text: 'vitepress 案例', link: '/markdown-examples' }
    ],

    sidebar: {
      '/guide/': [
        {
          text: 'Introduction',
          items: [
            { text: '前言', link: '/guide/introduction/index' },
          ]
        },
        {
          text: 'Base',
          items: [
            { text: '变量', link: '/guide/base/var' },
            { text: '常量', link: '/guide/base/const' },
            { text: '基础类型', link: '/guide/base/type' },
          ]
        }
      ],
      '/markdown-examples': [
        {
          text: '基础类型',
          items: [
            { text: 'Markdown Examples', link: '/markdown-examples' },
            { text: 'Runtime API Examples', link: '/api-examples' }
          ]
        }
      ],
      '/api-examples': [
        {
          text: '基础类型',
          items: [
            { text: 'Markdown Examples', link: '/markdown-examples' },
            { text: 'Runtime API Examples', link: '/api-examples' }
          ]
        }
      ]
    },

    // socialLinks: [
    //   { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    // ]
  },
  markdown: {
    container: {
      tipLabel: '提示',
      warningLabel: '注意',
      dangerLabel: '危险',
      infoLabel: '信息',
      detailsLabel: '详细信息'
    }
  },

  // build
  srcExclude: ['**/README.md', '**/TODO.md', 'README.md'],
})
